package src.elevent;

public class Example_05 {
    final static double PI = 3.14;
    public void computeArea(double r) throws Exception {
        if(r <= 20){
            throw new Exception("r不能小于20");
        }else {
            double circleArea = PI * r * r;
            System.out.println("半径是："+r+"的圆的面积是："+circleArea);
        }
    }

    public static void main(String[] args){
        Example_05 example05 = new Example_05();
        try {
            example05.computeArea(10);
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }
}
